package com.xue.qecode.utils;

import java.awt.*;
import java.awt.image.BufferedImage;

public class VerifyCode {
    private static int w = 40;
    private static int h = 26;

    public static BufferedImage getimage(String imageData) {
        BufferedImage bufferedImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics2D gs = bufferedImage.createGraphics();
        gs.setBackground(Color.WHITE);
        gs.setColor(Color.BLACK);




        gs.setFont(new Font("Menlo",Font.PLAIN,20));
        gs.clearRect(0, 0, w, h);
//        gs.fillRect(0,0,20,0);
        gs.drawString(imageData,3,20);
        gs.dispose();
        bufferedImage.flush();
        return bufferedImage;
    }
}
